/*
 * @Author: Qimu
 * @Date: 2020-04-25 06:40:21
 * @LastEditors: Qimu
 * @LastEditTime: 2020-09-08 08:51:00
 * @Description: file content
 * @FilePath: \vue-admin-koa2\vue-admin\src\main.js
 */
import Vue from 'vue'
import App from './App.vue'
import router from './router'
import store from './store'
import 'default-passive-events'
import Element from 'element-ui'
import 'normalize.css/normalize.css' // CSS重置
import '@/assets/css/global.sass' // 全局css
import api from '@/request/api/index';// 请求方法封装
import utils from '@/plugins/utils';// 工具方法封装
import 'element-ui/lib/theme-chalk/index.css';
import VueQuillEditor from 'vue-quill-editor' // 调用编辑器
import 'quill/dist/quill.core.css'
import 'quill/dist/quill.snow.css'
import 'quill/dist/quill.bubble.css'
import 'highlight.js/styles/vs2015.css'

import elmDialog from '@/components/Common/Dialog.vue'; //弹框组件
import elmTable from '@/components/Common/Table.vue';//表格组件
import elmPagination from '@/components/Common/Pagination.vue';//分页组件

// 挂载全局组件
Vue.component('elmDialog', elmDialog);
Vue.component('elmTable', elmTable);
Vue.component('elmPagination', elmPagination);

// import JSEncrypt from 'jsencrypt';
// import JSEncrypt from 'jsencrypt/bin/jsencrypt'
Vue.config.productionTip = false
Vue.prototype.$api = api;
Vue.prototype.$utils = utils;

// Vue.prototype.$getRsaCode = function (str) { // 注册方法
//   const pubKey = 'MIGJAoGBAMwBYDpfaAWds4NXT6n3MFlBKwtPm6TBWSNCrmL8QHB4ydXztyLAvzxgjpN/tt4DTO8wIsYtPRfVHrLLXbaocOXSLCIreMR8EzZSRrN1mW1kG47rQpKUin22Sdq5Bn2Baeb1HnF+w43bvVg9nhPOAJYZMthE+f7zGENVQX8u78JlAgMBAAE=';
//   const encryptStr = new JSEncrypt();
//   console.log('encryptStr', encryptStr);
//   encryptStr.setPublicKey(pubKey); // 设置 加密公钥
//   const data = encryptStr.encrypt(str); // 进行加密
//   console.log('data', data);
//   return data;
// }
// var encrypt = new JSEncrypt();
// encrypt.setPublicKey('Q3Q ZijLMjcKyC1whAzxtfVpy7G N1kpCGQJYO8dISQ1UyEzczC6vdqbwG18K6ylTv2fXujogOFwzgZlNuVTKEDVeHqjnsYjDcOUJqvE8t8Mxug vVMnAOsJfzL0eZqYREoq7YoDJ150q7xZB/8XZEfzwnc/4MwKJLHshj UFCc=');
// const password = encrypt.encrypt('alanchen');
// console.info(password);

Vue.use(Element, VueQuillEditor);

new Vue({
  router,
  store,
  render: h => h(App)
}).$mount('#app')
